package com.rightsidetech.mall.entity;

import java.io.Serializable;

/**
 * mall_agent_commodity
 * @author
 */
public class MallAgentCommodity implements Serializable {
    /**
     * 主键id
     */
    private Long id;

    /**
     * 代理商id
     */
    private Long agentId;

    /**
     * 商品id
     */
    private Long commodityId;

    /**
     * 商品顺序
     */
    private Long commodityOrder;

    /**
     * 代理商商品状态 0-正常 1-缺货
     */
    private Byte commodityStatus;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getAgentId() {
        return agentId;
    }

    public void setAgentId(Long agentId) {
        this.agentId = agentId;
    }

    public Long getCommodityId() {
        return commodityId;
    }

    public void setCommodityId(Long commodityId) {
        this.commodityId = commodityId;
    }

    public Long getCommodityOrder() {
        return commodityOrder;
    }

    public void setCommodityOrder(Long commodityOrder) {
        this.commodityOrder = commodityOrder;
    }

    public Byte getCommodityStatus() {
        return commodityStatus;
    }

    public void setCommodityStatus(Byte commodityStatus) {
        this.commodityStatus = commodityStatus;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MallAgentCommodity other = (MallAgentCommodity) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId()))
                && (this.getCommodityId() == null ? other.getCommodityId() == null : this.getCommodityId().equals(other.getCommodityId()))
                && (this.getCommodityOrder() == null ? other.getCommodityOrder() == null : this.getCommodityOrder().equals(other.getCommodityOrder()))
                && (this.getCommodityStatus() == null ? other.getCommodityStatus() == null : this.getCommodityStatus().equals(other.getCommodityStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode());
        result = prime * result + ((getCommodityId() == null) ? 0 : getCommodityId().hashCode());
        result = prime * result + ((getCommodityOrder() == null) ? 0 : getCommodityOrder().hashCode());
        result = prime * result + ((getCommodityStatus() == null) ? 0 : getCommodityStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", agentId=").append(agentId);
        sb.append(", commodityId=").append(commodityId);
        sb.append(", commodityOrder=").append(commodityOrder);
        sb.append(", commodityStatus=").append(commodityStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}